import Vue from 'vue'
import VueRouter from 'vue-router'

const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err)
}


Vue.use(VueRouter)
const routes = [
  /*******************************     登录    ***********************************/
  {
    path: '/',
    name: 'login',
    component: () => import('../components/login.vue')
  },
  /*******************************     整体概况    ***********************************/
  {
    path: '/index',
    name: 'index',
    component: () => import('../components/index.vue')
  },
  /*******************************     用户活跃度    ***********************************/
  {
    path: '/activity',
    name: 'activity',
    component: () => import('../components/activity.vue'),
    meta: {
      keepAlive: true // 需要被缓存
    }
  },
  /*******************************     备课情况    ***********************************/
  {
    path: '/prepare',
    name: 'prepare',
    component: () => import('../components/prepare.vue'),
    meta: {
      keepAlive: true // 需要被缓存
    }
  },
  /*******************************     授课情况    ***********************************/
  {
    path: '/lecture',
    name: 'lecture',
    component: () => import('../components/lecture.vue'),
    meta: {
      keepAlive: true // 需要被缓存
    }
  },
  /*******************************     资源包审核    ***********************************/
  {
    path: '/resources',
    name: 'resources',
    component: () => import('../components/resources.vue'),
    meta: {
      keepAlive: true // 需要被缓存
    }
  },
]
const router = new VueRouter({
  routes
})
export default router
